package optimizers.commons;


import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Serializable;
import java.util.Properties;

import fitness.Fitness;

public class RunConfig implements Serializable {
	/**
	 * 
	 */
	public final Properties properties = new Properties();
	
	public RunConfig(){
		try{
			try {
			 java.io.FileInputStream fis = new java.io.FileInputStream("run.properties");
			properties.load(fis);
	         fis.close();
			} catch (FileNotFoundException e) {
				System.out.println("No properties found. Creating file");
				PrintWriter prop = new PrintWriter("run.properties");
				prop.print("threads = "+Runtime.getRuntime().availableProcessors());
				prop.flush();
				prop.close();
				properties.put("threads", ""+Runtime.getRuntime().availableProcessors());
			} 
		}catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
         
		
		if(!properties.containsKey("threads")){
			properties.put("threads", ""+Runtime.getRuntime().availableProcessors());
		}
	}
	
	private static final long serialVersionUID = 1L;
	public static final int TEMPLATE_OPTIMIZE_NO = 0;
	public static final int TEMPLATE_OPTIMIZE_YES = 1;

	public static final int SEQK_OPTIMIZE_NO = 0;
	public static final int SEQK_OPTIMIZE_YES = 1;

	public static final int INHK_OPTIMIZE_NO = 0;
	public static final int INHK_OPTIMIZE_YES = 1;
	public static final int INHK_OPTIMIZE_NO_7_6_RULE = 2;
	public static final int INHK_OPTIMIZE_NO_PRESET = 3;

	public static final int EXO_OPTIMIZE_NO = 0;
	public static final int EXO_OPTIMIZE_YES = 1;

	public static final int POL_OPTIMIZE_NO = 0;
	public static final int POL_OPTIMIZE_YES = 1;

	public static final int NICK_OPTIMIZE_NO = 0;
	public static final int NICK_OPTIMIZE_YES = 1;

	public static final int SEQC_OPTIMIZE_NO = 0;
	public static final int SEQC_OPTIMIZE_YES = 1;

	public Parameter template;

	public Parameter seqK;

	public Parameter inhK;

	public Parameter exoActivity;
	
	public Parameter exoSimpleKm;
	
	public Parameter exoInhibKm;

	public Parameter polActivity;
	
	public Parameter polKm;
	
	public Parameter polDoubleStrandKm;

	public Parameter nickActivity;
	
	public Parameter nickKm;

	public Parameter seqC;

	public Fitness evaluator;

}
